package com.slimbloody.configs;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.math.BigDecimal;
import java.util.Map;

@Configuration
public class CacheConfig {
  @Bean(name = "userTcmQualityCache")
  public Cache<String, Map<String, BigDecimal>> get() {
    return Caffeine.newBuilder()
      .maximumSize(100)
      .recordStats()
      .build();
  }
}
